//
//  MyXYCardViewCell.m
//  PosApp
//
//  Created by 刘萍 on 2018/9/8.
//  Copyright © 2018年 李英新. All rights reserved.
//

#import "MyXYCardViewCell.h"

@implementation MyXYCardViewCell

- (void)setModel:(MyXYCardModel *)model{
    [self.CardImage sd_setImageWithURL:[NSURL URLWithString:model.card_icon] placeholderImage:[UIImage imageNamed:@"MainZWImage"]];
    self.CardName.text = [NSString stringWithFormat:@"%@",model.card_name];
    self.CardName01.text = [NSString stringWithFormat:@"%@",model.card_Bname];
    self.CardName01.adjustsFontSizeToFitWidth = YES;
    self.CardNumb.text = [NSString stringWithFormat:@"【%@】",model.card_number];
    self.OrderTime.text = [NSString stringWithFormat:@"%@",model.card_zd];
    self.HKTime.text = [NSString stringWithFormat:@"%@",model.card_hk];
    self.UserName.text = [NSString stringWithFormat:@"%@",model.card_member];
    [self.LogoBackImage sd_setImageWithURL:[NSURL URLWithString:model.card_icon] placeholderImage:[UIImage imageNamed:@"MainZWImage"]];
    
    if ([model.card_bind intValue] == 0) {
        self.XYCardLabel02.text = [NSString stringWithFormat:@"重新绑卡"];
    }else{
        if ([model.card_status isEqual:@"1"]) {
            self.XYCardLabel02.text = [NSString stringWithFormat:@"制定计划"];
        }else if ([model.card_status isEqual:@"2"]){
            self.XYCardLabel02.text = [NSString stringWithFormat:@"待执行"];
        }else{
            self.XYCardLabel02.text = [NSString stringWithFormat:@"查看计划"];
        }
    }
    
}

- (void)CreateMyXYCardViewCell{
    //设置背景阴影
    self.XYCardBackView.layer.cornerRadius = 10;
    self.XYCardBackView.layer.shadowColor = [UIColor colorWithRed:104/255.0 green:129/255.0 blue:253/255.0 alpha:0.68].CGColor;
    self.XYCardBackView.layer.shadowOffset = CGSizeMake(0,1);
    self.XYCardBackView.layer.shadowOpacity = 1;
    self.XYCardBackView.layer.shadowRadius = 27;
    
    //设置按钮边框
    self.XYCardLabel01.layer.cornerRadius = self.XYCardLabel01.bounds.size.height/2;
    self.XYCardLabel01.layer.borderWidth = 1;
    self.XYCardLabel01.layer.borderColor = [UIColor colorWithRed:91/255.0 green:91/255.0 blue:91/255.0 alpha:1].CGColor;
    
    self.XYCardLabel02.layer.cornerRadius = self.XYCardLabel02.bounds.size.height/2;
    self.XYCardLabel02.layer.borderWidth = 1;
    self.XYCardLabel02.layer.borderColor = [UIColor colorWithRed:26/255.0 green:140/255.0 blue:210/255.0 alpha:1].CGColor;
    
    //切掉logo多余部分
    self.LogoBackView.layer.cornerRadius = 10;
    self.LogoBackView.layer.masksToBounds = YES;
    
}
- (IBAction)ClickOnBtn01OfXYCardViewCell:(id)sender {
    [self.delegate ClickOnBtnOfMyXYCardViewCellToBottonBtn01:self.tag];
    
}
- (IBAction)ClickOnBtn02OfXYCardViewCell:(id)sender {
    [self.delegate ClickOnBtnOfMyXYCardViewCellToBottonBtn02:self.tag];
}




- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
